/*
 * @author: sanbao
 * @Date: 2022-07-31 14:50:02
 */
import {
  createStore
} from 'vuex'
import persist from 'vuex-persistedstate'
export default createStore({
  state: {
    searchval: '',
    tabindex: 0,
    userlist: {},
    // 选好的商品  
    okshoplist: []
  },
  getters: {},
  mutations: {
    search(state, search) {
      state.searchval = search
    },
    tab(state, obj) {
      state.tabindex = obj.tablist
    },
    userlist(state, obj) {
      state.userlist = obj
    },
    addshoplist(state, val) {
      state.okshoplist = val
    }
  },
  actions: {},
  modules: {},
  plugins: [
    new persist({
      storage: window.localStorage,
    }),
  ],
})